#!/bin/bash -x
#
# Things to do in the run dir:
# touch stop
# touch stop reload
#
# touching 'reload' is handy if you've changed the arguments to runalstates.py below

if [ -z ${REDISTRICTER_BIN} ]; then
	echo "need to set environment variable REDISTRICTER_BIN"
	exit 1
fi
if [ -z ${REDISTRICTER_DATA} ]; then
	echo "need to set environment variable REDISTRICTER_DATA"
	exit 1
fi

${REDISTRICTER_BIN}/runallstates.py --bestlog=bestlog --runlog=runlog --d2 --port=8080 --fr=3/7 "$@"
if [ -f reload ]; then
	rm -f reload
	exec ./runloop "$@"
fi
